<?php

use think\facade\Route;

Route::group('api', function(){

    Route::group(function () {
        Route::post('login', 'api.module.publics.Index/login');
        Route::post('register', 'api.module.publics.Index/register');
    });

    Route::group(function () {
        Route::group('room', function (){
            Route::post('create', 'api.module.game.Index/createRoom');       //createroom
            Route::post('exit', 'api.module.game.Index/exitRoom');       //leaveroom
            Route::post('enter', 'api.module.game.Index/enterRoom');     //joinroom
            Route::post('start', 'api.module.game.Index/startGame'); //savechesscolor
        });
        Route::group('match', function (){
            Route::post('record', 'api.module.game.Index/recordChessPosition');       //recordmatching
            Route::post('withdraw', 'api.module.game.Index/withdraw');           //stepback
            Route::post('result', 'api.module.game.Index/endGame');          //processingresults
        });
    });
})->domain(API_DOMAIN_NAME);